import React, { Component } from 'react'
import styles from './index.less'
import TelBookGroup from './TelBookGroup.js'
import TelBookContent from './TelBookContent.js'
import MyModal from './MyModal.js'
import { connect } from 'dva'

@connect(({ telBook, loading }) => ({ 
    telBookList: telBook.telBookList,
    addShow: telBook.addShow,
    selectedNode: telBook.selectedNode,
    upAddInfo: telBook.upAddInfo,
    telList: telBook.telList,
    page: telBook.page,
    total: telBook.total,
    fetchSelTelBookByUserIdLoading: loading.effects['telBook/fetchSelTelBookByUserId'],
    selName: telBook.selName,
    selPhone: telBook.selPhone
    //fetchSelLv1ByUserIdLoading: loading.effects['telBook/fetchSelLv1ByUserId'],
}))
export default class PersonalView extends Component {
    

    render() {
        return (
            <div className={styles.content}>
                {/* 通讯录分组 */}
                <TelBookGroup {...this.props} />
                {/* 通讯录内容 */}
                <TelBookContent {...this.props} />
                {/* 添加修改弹出框 */}
                <MyModal {...this.props}/>
            </div>
        )
    }
    componentDidMount(){
        const { dispatch } = this.props
        dispatch({
            type: 'telBook/fetchSelLv1ByUserId',
        })
    }
}
